package com.xyg.product.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.xyg.common.model.BaseEntity;

import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name="xyg_product_propertygroup")
public class PropertyGroup extends BaseEntity<PropertyGroup, Long> {

	private String name;
	
	@OneToMany(fetch=FetchType.LAZY,mappedBy="propertyGroup",cascade={CascadeType.REFRESH,CascadeType.PERSIST,CascadeType.REMOVE,CascadeType.MERGE})
	private Set<Property> properties = new HashSet<>();
	
	
}
